package com.atguigu.springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @version 1.0.0
 * Created by cyd on 2022-01-01 21:58:51
 * @ClassName : com.atguigu.springcloud.MainAppConfigCenter3344
 * @Description : 类描述
 */
@SpringBootApplication
@EnableConfigServer
public class MainAppConfigCenter3344 {

    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        context = SpringApplication.run(MainAppConfigCenter3344.class, args);
        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        System.out.println(port);
        System.out.println("http://localhost:" + port + "/master/config-test.yml");
    }
}
